<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"import="pojo.*,service.*,base.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    

  </head>
  
  <body>
<%
	String username = request.getParameter("username").trim();

    String password = request.getParameter("password").trim();

    MemberService ms =new MemberService();

    MemberLogin ml = ms.login(username, password);

   MemberInfor mi=ms.getMemberByUsername(username);
  
if(ml!=null&&mi.getPermit()==0){
	out.print("登录成功！");
	session.setAttribute("name",ml.getUsername());
	session.setAttribute("id",ml.getId());
	response.sendRedirect("../../website/index.jsp");
}

else if(ml!=null&&mi.getPermit()==1)
	out.print("你的用户名已失效 ！请重新注册<a href='../../website/regest.jsp'>注册</a>");

else out.print("登陆失败！！请重新登陆 <a href='../../website/login.jsp'>返回</a>");
	%>


</body>
 
</html>
